package com.day17me.java;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class Test1 {
    public static void main(String[] args) {
        Collection coll = new ArrayList();
        coll.add("Tom");
        coll.add("Jerry");

        Iterator itr = coll.iterator();

        while(itr.hasNext()){
             Object ojc = itr.next();
            String s = (String) ojc;
            System.out.println(s);
        }



    }
}
